home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 657 b | 35 lines | [TEXT/CWIE] |
- // RedBlackKey.cp
-
- #ifndef RedBlackKey_h
- #include "RedBlackKey.h"
- #endif
- #ifndef RedBlackKeyTree_h
- #include "RedBlackKeyTree.h"
- #endif
-
- template < class Key >
- RedBlackKeyTree<Key>& RedBlackKey<Key>::DownCast( TreeBase& t )
- {
- return static_cast< TreeType& >( t );
- }
-
- template < class Key >
- const RedBlackKeyTree<Key>& RedBlackKey<Key>::DownCast( const TreeBase& t )
- {
- return static_cast< const TreeType& >( t );
- }
-
- template < class KeyType >
- void RedBlackKey<KeyType>::SetKey( const KeyType& k )
- {
- if ( Owned() && key != k )
- {
- TreeType& owner( Owner() );
- owner.Remove( *this );
- key = k;
- owner.Add( *this );
- }
- else
- key = k;
- }
-